/**
 * 
 */
package com.ruyipu.forum.item;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

import com.ruyipu.forum.interfaces.IItem;

/**
 * @author donald
 * 
 */
public class Comment implements IItem, Serializable {
	public static final String TAG = Comment.class.getSimpleName();
	public static final String NAME = Comment.class.getName();
	
	private static final String COMMENT_ID = "CommentID";
	private static final String BODY = "Body";
	private static final String INSERT_NAME = "InsertName";
	private static final String INSERT_USER_ID = "InsertUserID";
	private static final String INSERT_PHOTO = "InsertPhoto";
	private static final String IP = "InsertIPAddress";
	
	
	private static final long serialVersionUID = -296028681648414638L;
	private int iCommentId;
	private String sBody;
	private String sInsertName;
	private int iInsertUserId;
	private String sInsertPhoto;
	private String sIP;
	

	public Comment() {
		
	}
	
//	private int DiscussionID;
//	private int InsertUserID;
//	private int DeleteUserID;
//	
//	private String Format;
//	private Date DateInserted;
//	private Date DateUpdated;
//	private String InsertIPAddress;
//	private String UpdateIPAddress;
//	private Short Flag;
//	private float Score;
//	private String Attributes;
	
	public int getId() {
		return iCommentId;
	}
	
	public String getBody() {
		return sBody;
	}
	
	public String getInsertName() {
		return sInsertName;
	}
	
	public int getInsertUserId() {
		return iInsertUserId;
	}

	public String getInsertPhoto() {
		return sInsertPhoto;
	}
	
	public String getIP() {
		return sIP;
	}

	public void parse(JSONObject jsonObject) throws JSONException {
		iCommentId = jsonObject.getInt(COMMENT_ID);
		sBody = jsonObject.getString(BODY);
		sInsertName = jsonObject.getString(INSERT_NAME);
		sInsertPhoto = jsonObject.getString(INSERT_PHOTO);
		iInsertUserId = jsonObject.getInt(INSERT_USER_ID);
		sIP = jsonObject.getString(IP);
	}
}
